import request from "@/router/axios";

// =====================  menu  =====================
export const menu_tree = (params) =>
  request({
    url: "api/sys/menu/tree",
    method: "GET",
    params,
  });

export const menu_edit = (params) =>
  request({
    url: "api/sys/menu/edit",
    method: "POST",
    data: params,
  });

export const menu_add = (params) =>
  request({
    url: "api/sys/menu/add",
    method: "POST",
    data: params,
  });

export const menu_delete = (params) =>
  request({
    url: "api/sys/menu/delete",
    method: "GET",
    params,
  });

// =====================  role  =====================
export const role_page = (params) =>
  request({
    url: "api/sys/role/page",
    method: "GET",
    params,
  });
export const role_tree = (params) =>
  request({
    url: "api/sys/role/tree",
    method: "GET",
    params,
  });
export const role_delete = (params) =>
  request({
    url: "api/sys/role/delete",
    method: "GET",
    params,
  });
export const role_edit = (params) =>
  request({
    url: "api/sys/role/edit",
    method: "POST",
    data: params,
  });
export const role_add = (params) =>
  request({
    url: "api/sys/role/add",
    method: "POST",
    data: params,
  });
export const role_getRoleMenu = (params) =>
  request({
    url: "api/sys/role/getRoleMenu",
    method: "GET",
    params,
  });

export const role_getRoleUser = (params) =>
  request({
    url: "api/sys/role/getRoleUser",
    method: "GET",
    params,
  });

export const role_setRoleMenu = (params) =>
  request({
    url: "api/sys/role/setRoleMenu",
    method: "POST",
    data: params,
  });

export const role_setRoleUser = (params) =>
  request({
    url: "api/sys/role/setRoleUser",
    method: "POST",
    data: params,
  });

// =====================  user  =====================
export const user_page = (params) =>
  request({
    url: "api/sys/user/page",
    method: "GET",
    params,
  });
export const user_delete = (params) =>
  request({
    url: "api/sys/user/delete",
    method: "GET",
    params,
  });
export const user_edit = (params) =>
  request({
    url: "api/sys/user/edit",
    method: "POST",
    data: params,
  });
export const user_add = (params) =>
  request({
    url: "api/sys/user/add",
    method: "POST",
    data: params,
  });
export const user_getUserRole = (params) =>
  request({
    url: "api/sys/user/getUserRole",
    method: "GET",
    params,
  });
export const user_setUserRole = (params) =>
  request({
    url: "api/sys/user/setUserRole",
    method: "POST",
    data: params,
  });

// =====================  oauthClientDetails  =====================

export const oauthClientDetails_page = (params) =>
  request({
    url: "api/sys/oauthClientDetails/page",
    method: "GET",
    params,
  });
